#include "password.h"
#include "ui_password.h"

#include <QMessageBox>

passWord::passWord(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::passWord)
{
    ui->setupUi(this);
    this->setWindowTitle("密码");
    this->setWindowFlags(this->windowFlags() &~ Qt::WindowMinMaxButtonsHint);

    weihu = new maintain();
    cusMsg = new CustomMessageBox();

    QString rightPass = config->getWeihuPassword();


    connect(ui->back, &QPushButton::clicked, this, [=](){
        input = ui->passWordLine->text();
        if(input == rightPass){
            weihu->show();
            ui->passWordLine->clear();
            this->hide();
        }
        else{
            cusMsg->show(this, CMsg::CWarning, "提示", "密码错误");
            ui->passWordLine->clear();
        }
    });



}

passWord::~passWord()
{
    delete ui;
}
